#ifndef __TIMER_H__
#define __TIMER_H__

//PUBLIC:
	//Data Member:
	struct __timer_t {
  		uint8_t started : 1;
  		uint8_t periodic : 1;
  		uint16_t period;
  		uint32_t expired;
  		void (*run)(void);
		struct __timer_t *prev;
  		struct __timer_t *next;
	};
	typedef struct __timer_t timer_t;
	//Function Member:
	void TIMER_init(void);
	void TIMER_reg(timer_t *t, void (*run)(void));
	void TIMER_start(timer_t *t, uint16_t time);
	void TIMER_startPeriodic(timer_t *t, uint16_t time);
	void TIMER_run(void);
	void TIMER_stop(timer_t *t);
	
#endif // __TIMER_H__